<html>
<body>
<cffunction name="dumpvar">
  <cfargument name="var" default="blank">
  <cfargument name="abort" default="true">
  <cftry>
	  <cfdump var="#var#">
	<cfcatch>
	  <cfset writeoutput(cfcatch.Message & " " & cfcatch.Detail & " " & cfcatch.TagContext[1].line & " " & cfcatch.stacktrace) />
	</cfcatch>
	</cftry>
	<cfif arguments.abort>
	  <cfabort />
	</cfif>
</cffunction>

<a href="?startserver=1">Start server</a> |
<a href="?stopserver&init=1">Inits</a> |
<a href="?stopserver=1">Stop server</a> |
<br />
<a href="?getmessages=1">Get Messages</a> |
<a href="?testmessage=1">Test Message</a> |
<a href="?viewmessage=1">View Message</a> |
<a href="?deletemessages=1">Delete Message</a> | |
<a href="mail.html">MAIL</a>
<br />

<cfscript>
	if (structKeyExists(url,"startserver")) {
		request.smtpServer.startserver();
		writeoutput('Started');
	}

	if (structKeyExists(url,"stopserver")) {
		request.smtpServer.stopserver();
		writeoutput('Stopped');
	}

	if (structKeyExists(url,"getmessages")) {
		messages = request.smtpServer.getMessagesAsStruct();
		for(x = 1; x lte arrayLen(messages); x = x+1) {
			writeoutput(messages[x]["subject"] & "<br />");
		}
	}

	if (structKeyExists(url,"deletemessages")) {
		request.smtpServer.clearmessages();
	}

	if (structKeyExists(url,"testmessage")) {
		request.smtpServer.testmessage();
	}

	if (structKeyExists(url,"viewmessage")) {
		request.smtpServer.getMessagesAsStruct();
	}
</cfscript>

</body>
</html>
